<?php

namespace application\Model;

use library\Core\Db\CDbOperator;
use library\Core\Db\CDbCriteria;
use application\Table\FlowLog;

class FlowLogModel extends CDbOperator
{
    public function getListForClass(CDbCriteria $criteria)
    {
        $criteriaBuilder = $criteria->getCriteriaBuilder(FlowLog::getInstance());

        return $this->query($criteriaBuilder);
    }

    public function getListForArray(CDbCriteria $criteria)
    {
        $criteriaBuilder = $criteria->getCriteriaBuilder(FlowLog::getInstance());

        return $this->query($criteriaBuilder, true);
    }

    public function getRow(CDbCriteria $criteria)
    {
        $criteriaBuilder = $criteria->getCriteriaBuilder(FlowLog::getInstance());

        return $this->queryRow($criteriaBuilder, true);
    }

    public function getOne(CDbCriteria $criteria)
    {
        $criteriaBuilder = $criteria->getCriteriaBuilder(FlowLog::getInstance());

        return $this->queryOne($criteriaBuilder, true);
    }

    public function add(CDbCriteria $criteria)
    {
        $criteriaBuilder = $criteria->getCriteriaBuilder(FlowLog::getInstance());

        return $this->insert($criteriaBuilder);
    }

    public function modify(CDbCriteria $criteria)
    {
        $criteriaBuilder = $criteria->getCriteriaBuilder(FlowLog::getInstance());

        return $this->update($criteriaBuilder);
    }

    public function remove(CDbCriteria $criteria)
    {
        $criteriaBuilder = $criteria->getCriteriaBuilder(FlowLog::getInstance());

        return $this->delete($criteriaBuilder);
    }
}
